<#assign basePath=request.contextPath>
<#include "${basePath}/include.ftl" >
<body>
    <div class="layui-container" style="padding: 15px 20px 20px 20px;">
        <form class="layui-form layui-form-pane" action="" id="form">
            <div class="layui-form-item">
                <label class="layui-form-label layui-input-required">登录名称:</label>
                <div class="layui-input-block">
                    <input type="text" name="loginName" autocomplete="off" placeholder="以字母开头,4到10个字母或数字组成" class="layui-input" validate="required|loginName" >
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label layui-input-required">部门名称:</label>
                <div class="layui-input-block">
                    <input type="text" name="deptName" autocomplete="off" placeholder="请选择部门" class="layui-input" readonly="true"
                           style="background-color: #eee;" onclick="setDeptId()" id="deptName" validate="required">
                    <!-- 部门id  -->
                    <input type="hidden" name="deptId" autocomplete="off" class="layui-input" readonly="true"
                           style="background-color: #eee;"  id="deptId" >
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label layui-input-required">用户名称:</label>
                <div class="layui-input-block">
                    <input type="text" name="userName" autocomplete="off" placeholder="请输入用户名称" class="layui-input" validate="required">
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label layui-input-required">用户密码:</label>
                <div class="layui-input-block">
                    <input type="text" name="password" autocomplete="off" placeholder="以大写字母开头,4位以上个字母或数字组成" class="layui-input" validate="required|passWord">
                </div>
            </div>

            <div class="layui-form-item" pane="">
                <label class="layui-form-label layui-input-required">账号状态:</label>
                <div class="layui-input-block">
                    <input type="radio" name="status" value="0" title="正常" checked="">
                    <input type="radio" name="status" value="1" title="停用">
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label">手机:</label>
                <div class="layui-input-block">
                    <input type="number" name="phonenumber" autocomplete="off" placeholder="请输入手机" class="layui-input" validate="telphone">
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label">邮箱:</label>
                <div class="layui-input-block">
                    <input type="text" name="email" autocomplete="off" placeholder="请输入邮箱" class="layui-input" validate="email">
                </div>
            </div>

            <div class="layui-form-item" pane="">
                <label class="layui-form-label layui-input-required">性别:</label>
                <div class="layui-input-block">
                    <input type="radio" name="sex" value="0" title="男" checked="">
                    <input type="radio" name="sex" value="1" title="女">
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label layui-input-required">岗位:</label>
                <div class="layui-input-block">
                    <select name="postIds" autocomplete="off" id="postId" validate="required">
                        <option value="">请选择岗位</option>
                    </select>
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label layui-input-required">角色:</label>
                <div class="layui-input-block">
                    <input type="text" name="roleNames" id="roleNames" style="background-color: #eee;" autocomplete="off" placeholder="请选择角色" class="layui-input" readonly="true" onclick="setRole()" validate="required">
                    <!-- 角色id组  -->
                    <input type="hidden" name="roleIds" autocomplete="off" class="layui-input" readonly="true"
                           style="background-color: #eee;"  id="roleIds" value="" >
                </div>
            </div>
        </form>
    </div>
</body>
<script type="text/javascript" src="${baseApp}/system/user/user_insert.js"></script>
